import { IpcEvent } from 'app/type'
import { ipcMain, shell } from 'electron'

export class IpcChannel {
    static init() {
        // 切换控制台
        ipcMain.on(IpcEvent.APP_DEVTOOLS_TOGLE, (e) => e.sender.toggleDevTools())
        // 用浏览器打开链接
        ipcMain.on(IpcEvent.OPEN_URL, (e, url: string) => shell.openExternal(url))
    }
}
